﻿<%@ Page Title="友情链接管理" Language="C#" MasterPageFile="~/Admin/ListPage.master" AutoEventWireup="true" CodeFile="FriendLink.aspx.cs" Inherits="NewsPub_FriendLink" %>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="C">
    
 <div class="tools_box">
            <div class="tools_bar">
                <div class="search_box">
                    关键字：<asp:TextBox ID="txtKey" runat="server" CssClass="txtInput"></asp:TextBox>
                    <asp:Button ID="btnSearch" runat="server" Text="搜 索" CssClass="btnSearch" />
                </div>
                <a href="FriendLinkForm.aspx" class="tools_btn"><span><b class="add">添加FriendLink</b></span></a>   
                <%--<a href="**.aspx" class="tools_btn"><span><b class="return">**管理</b></span></a>
                 <asp:LinkButton ID="btnEnable" runat="server" CssClass="tools_btn"
                    OnClientClick="return confirm('确定批量启用吗？')" OnClick="btnEnable_Click"><span><b class="error">批量启用</b></span></asp:LinkButton>
                 <asp:LinkButton ID="btnDisable" runat="server" CssClass="tools_btn"
                    OnClientClick="return confirm('确定批量禁用吗？')" OnClick="btnDisable_Click"><span><b class="delete">批量禁用</b></span></asp:LinkButton>
                <asp:LinkButton ID="btnDelete" runat="server" CssClass="tools_btn"
                    OnClientClick="return confirm('确定批量删除吗？')" OnClick="btnDelete_Click"><span><b class="delete">批量删除</b></span></asp:LinkButton>--%>		
            </div>
    </div>

    <asp:GridView ID="gv" runat="server" AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="ods" 
        AllowPaging="True" AllowSorting="false" CssClass="msgtable" PageSize="20" CellPadding="0" 
        GridLines="None" EnableModelValidation="True" OnRowCommand="GridView1_RowCommand" EnableViewState="False">
        <Columns>
            <asp:BoundField DataField="ID" HeaderText="编号" InsertVisible="False" ReadOnly="True"
                SortExpression="ID">
                <HeaderStyle Width="40px" />
                <ItemStyle CssClass="key" HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="TreeNodeName" HeaderText="名称" SortExpression="Name" />
            <asp:BoundField DataField="Url" HeaderText="链接" SortExpression="Url" />
            <asp:BoundField DataField="ParentFriendLinkName" HeaderText="父菜单" SortExpression="ParentID" />
            <asp:BoundField DataField="Sort" HeaderText="序号" SortExpression="Sort" />
            <%--<asp:BoundField DataField="Permission" HeaderText="权限" SortExpression="Permission" />
            <asp:TemplateField HeaderText="显示">
                <ItemTemplate>
                    <asp:CheckBox ID="checkebox1" runat="server" Enabled="false" Checked='<%# Bind("IsShow") %>' />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="Remark" HeaderText="备注" SortExpression="Remark" />--%>
            <asp:TemplateField HeaderText="升" ShowHeader="False">
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandArgument='<%# Eval("ID") %>'
                        CommandName="Up" Text="↑" Font-Size="12pt" ForeColor="Red"></asp:LinkButton>
                </ItemTemplate>
                <ItemStyle Font-Size="12pt" ForeColor="Red" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="降" ShowHeader="False">
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="False" CommandArgument='<%# Eval("ID") %>'
                        CommandName="Down" Text="↓" Font-Size="12pt" ForeColor="Green"></asp:LinkButton>
                </ItemTemplate>
                <ItemStyle Font-Size="12pt" ForeColor="Green" />
            </asp:TemplateField>
            <%--<XCL:LinkBoxField HeaderText="添加子菜单" DataNavigateUrlFields="ID" DataNavigateUrlFormatString="FriendLinkForm.aspx?ParentID={0}"
                Height="400px" Text="添加子菜单" Width="370px" Title="添加子菜单">
                <ItemStyle HorizontalAlign="Center" />
            </XCL:LinkBoxField>
            <XCL:LinkBoxField HeaderText="编辑" DataNavigateUrlFields="ID" DataNavigateUrlFormatString="FriendLinkForm.aspx?ID={0}"
                Height="400px" Text="编辑" Width="370px" Title="编辑菜单">
                <ItemStyle HorizontalAlign="Center" />
            </XCL:LinkBoxField>--%>
            <asp:TemplateField HeaderText="添加子菜单" SortExpression="Name">
                <ItemTemplate>
                    <asp:HyperLink ID="HyperSub" runat="server" Text='添加子菜单' NavigateUrl='<%# "FriendLinkForm.aspx?ParentID="+Eval("ID") %>'></asp:HyperLink>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="编辑" SortExpression="Name">
                <ItemTemplate>
                    <asp:HyperLink ID="HyperManager" runat="server" Text='编辑' NavigateUrl='<%# "FriendLinkForm.aspx?ID="+Eval("ID") %>'></asp:HyperLink>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="删除" ShowHeader="False">
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete"
                        OnClientClick="return confirm('确定删除？');" Text="删除"></asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:CheckBoxField />
			
        </Columns>
        <EmptyDataTemplate>
            没有符合条件的数据！
        </EmptyDataTemplate>
    </asp:GridView>
    <asp:ObjectDataSource ID="ods" runat="server" DeleteMethod="Delete" SelectMethod="FindAllChildsNoParent"
        EnableViewState="False">
        <SelectParameters>
            <asp:Parameter DefaultValue="0" Name="parentKey" Type="Object" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <XCL:GridViewExtender ID="gvExt" runat="server">
    </XCL:GridViewExtender>
</asp:Content>